package com.sdstc.modules.dao;

import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sdstc.modules.eneity.OrgDetailYear;
import com.sdstc.modules.vo.BarEchartsVo;
import org.apache.ibatis.annotations.Select;

/**
 * 机构年份详情Mapper接口
 *
 * @author ruoyi
 * @date 2022-11-11
 */
public interface OrgDetailYearDao extends BaseMapper<OrgDetailYear>
{
//    @Select("select b.* from(select max(create_time) as create_time from org_detail_year where org_id = #{orgId} and year(create_time)>=year(date_sub(now(),interval 4 year)) group by year(create_time) order by year(create_time) desc) a LEFT JOIN org_detail_year b on a.create_time = b.create_time order by b.create_time")
    @Select("select b.* from(select max(create_time) as create_time from org_detail_year where org_id = #{orgId} group by year(create_time) order by year(create_time) desc) a LEFT JOIN org_detail_year b on a.create_time = b.create_time order by b.create_time")
    List<OrgDetailYear> queryBarEchartsData(String orgId);
}
